from ast import Dict
from service.das.test import JsonPlaceholderReplacer
from service.setting_service import DataDictionaryService
from views.common.translator import Translator
from views.template_page_view import BasePageTemplateView, FormItemDto


class CommonSettingView(BasePageTemplateView):

    def __init__(self, parent=None):
        t = Translator()
        super().__init__("CommonSettingView", parent=parent)

    def doInitAndUpdate(self):

        self.addEchatTemplate("当前持股","home_current_stock",self.exhcangeStockInfo self.commonSettingCallback)

    def exhcangeStockInfo(jsonData: str, params: Dict[str, str]) -> str:
        print(f"传入查询的对象信息{params}")
        replacer = JsonPlaceholderReplacer(jsonData)
        return replacer.get_modified_json()
    
    def getBaseParam()-> Dict[str, str]:
        return {
            "key1": "value1",
            "key2": "value2",
            "key3": "value3"
        } 